/**
 * @author MIAO
 * Created on 2011-11-13
 * For more information, please visit:ismiao.com
 */
package com.ismiao.java.DateTime;

import java.util.Calendar;
import java.util.Date;

public class GetCalendar {
	public static void main(String[] args) {
		long l = System.currentTimeMillis();
		Date date = new Date(l);
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		System.out.println(cal.get(Calendar.YEAR));
		System.out.println(cal.get(Calendar.MONTH) + 1);// 月份计算是从0作为1开始的。
		System.out.println(cal.get(Calendar.DATE));
		System.out.println(cal.get(Calendar.HOUR) + 12);
		System.out.println(cal.get(Calendar.MINUTE));
		System.out.println(cal.get(Calendar.SECOND));
	}
}
